# Contributor: Vesa Kaihlavirta <vegai@iki.fi>
# Contributor: Angelo Theodorou <encelo@users.sourceforge.net>

pkgname=warzone2100
pkgver=4.3.5
pkgrel=1
pkgdesc="3D realtime strategy game on a future Earth"
url="https://wz2100.net/"
arch=('loong64' 'x86_64')
license=('GPL')
depends=('sdl2' 'openal' 'libvorbis' 'libtheora' 'libsodium' 'physfs' 'sqlite' 'freetype2' 'opus')
makedepends=('zip' 'unzip' 'libzip' 'asciidoc' 'mesa' 'vulkan-headers' 'shaderc' 'cmake' 'ninja')
source=(${pkgname}-${pkgver}_src.tar.xz::https://github.com/Warzone2100/warzone2100/releases/download/${pkgver}/${pkgname}_src.tar.xz)
sha256sums=('01d608f6f9638e14d7c857df40ad339c1bfc207a05daafe7157ad8652a3405c3')

build() {
  cmake -B build -S ${pkgname} \
    -G Ninja \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DWZ_DISTRIBUTOR="ArchLinux" \
    -Wno-dev
  cmake --build build
}

package() {
  DESTDIR="${pkgdir}" cmake --install build
}
